<template>
  <div class="bastItem">
    <van-image :src="bastItem.image" />
    <div class="itemRight">
      <span class="goodsName">{{ bastItem.store_name }}</span>
      <div class="goodsPrice">
        <span class="firstPrice">￥{{ bastItem.price }}</span>
        <div>
          <span>￥{{ bastItem.vip_price }}</span>
          <span class="iconfont icon-vip"></span>
          <span>已售{{ bastItem.sales }}</span>
        </div>
      </div>
      <div class="cartIcon iconfont icon-gouwuche"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "BastItem",
  props: ["bastItem"],
};
</script>

<style lang="less" scoped>
.bastItem {
  display: flex;
  padding: 2.6vh 0;

  .van-image {
    width: 25vw;
    height: 25vw;
    padding-bottom: 4vh;
    padding-right: 4vw;
  }
  div.itemRight {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    span.goodsName {
      text-align: left;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2; /* 可以显示的行数，超出部分用...表示*/
      -webkit-box-orient: vertical;
    }
    div.goodsPrice {
      margin-bottom: 2vh;
      text-align: left;
      .firstPrice {
        font-size: 0.4rem;
        color: red;
        font-weight: bolder;
      }
      div {
        padding-top: 0.8vh;
        display: flex;
        flex-wrap: wrap;
        span {
          &:first-of-type {
            font-size: 0.32rem;
            font-weight: bold;
          }
          &:nth-of-type(2) {
            color: red;
            font-size: 0.55rem;
          }
          &:nth-of-type(3) {
            margin-left: 1.6vw;
            font-size: 0.32rem;
            color: rgb(192, 188, 188);
          }
        }
      }
    }
    // 购物车图标
    .cartIcon {
      position: absolute;
      right: 2vw;
      bottom: 2.4vh;
      font-size: 0.7rem;
      color: red;
    }
  }
}
</style>